pp108 : Assign Task

Assign Task

This method is used by the work list manager, team manager, or any user who has the NotificationAdmin role, to assign a task to a user. 

Resource URI
/v1/tasks/assignTask
Request Type

HTTP POST

HTTP Header Parameters

Parameter

Description

Accepted Input Values

SAMLart

The SAML artifact received after authentication. For more information on how to authenticate, see Login.
otdsticket The OTDSTicket received after authentication from OTDS. The OTDSTicket must be provided as a header parameter. For more information on how to authenticate, see Login.

Note : You must provide either SAMLart or otdsticket header parameter. If we provide both the header parameters, it will internally work based on SAMLart.

Note: The supported output formats are:

  • JSON
  • XML
Request Parameters

Parameter

Description

Accepted Input Values

taskId Contains the unique identifier of the task. For example:
taskId: 002481F0-8E9F-11E3-FB98-BD04D5FA7BB1

assignTo

Contains the DN of the assignee, who claims the task or to whom the task is assigned by the manager.

The attributes are as follows:

  • displayName - Display name of the user as mentioned in the user manager or as it is in the LDAP
  • phone1 - Phone number as mentioned in the contact details while creating a user
  • phone2 - Phone number as mentioned in the contact details while creating a user
  • email - Email ID as mentioned in the contact details while creating a user

For example:

assignTo:cn=NewLaxman,cn=organizational users,o=system,cn=cordys,cn=defaultinst,o=opentext.net

dueDate

Contains the date by which the task must be completed.  

Any date with the Cordys Date Format

Note: All the above parameters must be send inside the AssignTask object in the payload section of the HTTP call.

Sample HTTP Payload

POST accepts the payload content only in the XML format as follows:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <AssignTask xmlns="http://schemas.cordys.com/notification/workflow/1.0">
 <TaskId>002481F0-8E9F-11E3-FE11-D428C7EAD7E1</TaskId>
  <TaskId>002481F0-8E9F-11E3-FE11-D428C7EB97E1</TaskId>
 <AssignedTo>cn=lgautam,cn=organizational users,o=system,cn=cordys,cn=OTDS_Cordys1,o=mydomain.com</AssignedTo>
 </AssignTask>
Sample Client Example

Add the HTTP Payload as follows:

com.cordys.entity.bean.AssignTask assignTaskObj = new com.cordys.entity.bean.AssignTask();
 assignTaskObj.setTaskId("002481F0-8E9F-11E3-FE11-D428C7EAD7E1");
 assignTaskObj.setTaskId("002481F0-8E9F-11E3-FE11-D428C7EB97E1");
 assignTaskObj.setAssignedTo("cn=lgautam,cn=organizational users,o=system,cn=cordys,cn=OTDS_Cordys1,o=mydomain.com");
StringWriter writer = new StringWriter();
 JAXBContext jaxbContext = JAXBContext.newInstance(com.cordys.jaxws.task.assigntask.AssignTask.class);
 Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
 jaxbMarshaller.marshal(assignTaskObj, writer);
 
 DefaultHttpClient httpClient = new DefaultHttpClient();
 // Define a postRequest request
 HttpPost postRequest = new HttpPost("http://<HOST>:<POST>/BPMService/v1/tasks/assignTask");
 
 // Set the request post body
 StringEntity userEntity = new StringEntity(writer.getBuffer().toString());
 postRequest.setEntity(userEntity);

 

 

public Response assignTask(com.cordys.entity.bean.AssignTask taskGoingToAssign)

Note: The com.cordys.entity.bean.AssignTask object structure has been attached below, which is expected as a parameter of the REST API:

AssignTask.java class is packed on BPMServiceClient.jar.


Response Parameters

BusinessAttributes

Parameter

Description

TaskId

Contains the unique task ID

Sender

Contains the DN of the sender of the task. The attributes are as follows:

  • displayName - Display name of the user as mentioned in the user manager or as it is in the LDAP
  • phone1 - Phone number as mentioned in the contact details while creating a user
  • phone2 - Phone number as mentioned in the contact details while creating a user
  • email - Email ID as mentioned in the contact details while creating a user

Assignee

Contains the DN of the assignee who claims the task or to whom the task is assigned by the manager. The attributes are as follows:

  • displayName - Display name of the user as mentioned in the user manager or as it is in the LDAP
  • phone1 - Phone number as mentioned in the contact details while creating a user
  • phone2 - Phone number as mentioned in the contact details while creating a user
  • email - Email ID as mentioned in the contact details while creating a user

CompletedByUser

Contains the DN of the user who completes the task

DelegatedToUser

Contains the DN of the user to whom the task is delegated

CompletionDate

Contains date on which the task is completed

StartedOn

Contains date on which the task has been started

LoggerContext Contains logger process and instance

Targets

Type of target where the task must be sent

ParentTaskId

This ID is used to group all the tasks that are assigned to the same role with the All linked users must execute task option enabled in the business process properties

StartDate

Contains the date when the task can be started

DueDate isExpired

Contains the date when the task must be completed. When isExpired is true, the due date is already past.

DeliveryDate

Contains the date when the task is completed

State

Contains the current state of the task. For example: Assigned, InProgress 

Priority

Contains the priority that is set on the task

Activity

Contains the name of the activity specified in the business process

Sample Response
JSON Response : 
{
	task: [1]0: {
		taskId: "002481F0-8E9F-11E3-FC46-4707E0AB1F8A"parentTaskId: "002481F0-8E9F-11E3-FC46-4707E0AB1F8A"processInstanceId: "002481F0-8E9F-11E3-FC46-4707E0AABF8A"state: "ASSIGNED"processName: "bpmSample"activity: "Notif Subject"sender: {
			value: "cn=lgautam,cn=organizational users,o=system,cn=cordys,cn=defaultinst,o=opentext.net"displayName: "lgautam"phone1: ""phone2: ""email: ""
		}-businessAttributes: {
			attribute: [0]
		}-assignee: {
			value: "cn=NewLaxman,cn=organizational users,o=system,cn=cordys,cn=defaultinst,o=opentext.net"displayName: "NewLaxman User"phone1: ""phone2: ""email: ""
		}-completedByUser: {
			value: ""displayName: nullphone1: nullphone2: nullemail: null
		}-delegatedToUser: {
			value: ""displayName: nullphone1: nullphone2: nullemail: null
		}-loggerContext: "<Logger xmlns:SOAP="http: //schemas.xmlsoap.org/soap/envelope/" xmlns="http: //schemas.cordys.com/General/1.0/"><DC name="process">bpmSample</DC><DC name="instance">002481F0-8E9F-11E3-FC46-4707E0AABF8A</DC></Logger>"deliveryDate: "2014-05-23T04:25:13.0"startDate: "0"dueDate: {
			value: ""isExpired: false
		}-startedOn: ""completionDate: ""isPriorityFixed: falsepriority: "3"parentQueue: ""url: "ui.caf"activityId: "o_2"component: "BPM"callBackInfo: {
			any: [6]0: "<?xml version="1.0" encoding="UTF-16"?> <ModelName xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/">bpmSample</ModelName>"1: "<?xml version="1.0" encoding="UTF-16"?> <InstanceId xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/">002481F0-8E9F-11E3-FC46-4707E0AABF8A</InstanceId>"2: "<?xml version="1.0" encoding="UTF-16"?> <ActivityId iterationCount="1" xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/">o_2</ActivityId>"3: "<?xml version="1.0" encoding="UTF-16"?> <ActivityName xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/">ui</ActivityName>"4: "<?xml version="1.0" encoding="UTF-16"?> <ParentSourceInstanceId type="BPM" xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/">0</ParentSourceInstanceId>"5: "<?xml version="1.0" encoding="UTF-16"?> <RootInstanceId type="PROCESS" xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/">002481F0-8E9F-11E3-FC46-4707E0AABF8A</RootInstanceId>"-
		}-targets: {
			target: [1]0: {
				content: "002481F0-8E9F-11E3-FB84-31AE2052D713"type: "worklist"
			}--
		}-taskData: {
			applicationData: {
				any: "<?xml version="1.0" encoding="UTF-16"?> <proc:forminputdata xmlns="http: //schemas.cordys.com/1.0/xforms/processapi" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/" xmlns:proc="http: //schemas.cordys.com/1.0/xforms/processapi"><proc:freeformcontrols><proc:input1 display_name="Input1"/></proc:freeformcontrols></proc:forminputdata>"
			}-customData: {
				any: null
			}-links: nullannotation: {
				any: null
			}-url: null
		}-possibleActions: {
			assign: nullclaim: nullrevokeclaim: "<?xml version="1.0" encoding="UTF-16"?> <REVOKECLAIM xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"complete: "<?xml version="1.0" encoding="UTF-16"?> <COMPLETE xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"delegate: "<?xml version="1.0" encoding="UTF-16"?> <DELEGATE xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"forward: "<?xml version="1.0" encoding="UTF-16"?> <FORWARD xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"pause: nullresume: nullstart: "<?xml version="1.0" encoding="UTF-16"?> <START xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"stop: nullsuspend: "<?xml version="1.0" encoding="UTF-16"?> <SUSPEND xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"skip: "<?xml version="1.0" encoding="UTF-16"?> <SKIP xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"execute: "<?xml version="1.0" encoding="UTF-16"?> <EXECUTE xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"view: "<?xml version="1.0" encoding="UTF-16"?> <VIEW xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"transfer: "<?xml version="1.0" encoding="UTF-16"?> <TRANSFER xmlns="http: //schemas.cordys.com/notification/workflow/1.0" xmlns:S="http: //schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http: //schemas.cordys.com/General/1.0/"/>"changeduedate: null
		}-uitaskId: {
			value: "002481F0-8E9F-11E3-FB7E-550D94D39713"islegacy: "false"
		}-
	}--state: "ASSIGNED"assignee: {
		value: "cn=NewLaxman,cn=organizational users,o=system,cn=cordys,cn=defaultinst,o=opentext.net"displayName: "NewLaxman User"phone1: ""phone2: ""email: ""
	}-
}
===================================================================================================================================================================
 
SOAP Response : 
 
<AssignTaskResponse xmlns="http://schemas.cordys.com/notification/workflow/1.0" xmlns:ns2="http://schemas.cordys.com/General/1.0/">
	<Task>
		<ProcessInstanceId>002481F0-8E9F-11E3-FC46-4707E0AABF8A</ProcessInstanceId>
		<ProcessName>bpmSample</ProcessName>
		<TaskId>002481F0-8E9F-11E3-FC46-4707E0AB1F8A</TaskId>
		<ParentTaskId>002481F0-8E9F-11E3-FC46-4707E0AB1F8A</ParentTaskId>
		<State>ASSIGNED</State>
		<Activity>Notif Subject</Activity>
		<Sender displayName="lgautam" email="" phone1="" phone2="">cn=lgautam,cn=organizational users,o=system,cn=cordys,cn=defaultinst,o=opentext.net</Sender>
		<Assignee displayName="NewLaxman User" email="" phone1="" phone2="">cn=NewLaxman,cn=organizational users,o=system,cn=cordys,cn=defaultinst,o=opentext.net</Assignee>
		<BusinessAttributes/>
		<CompletedByUser/>
		<DelegatedToUser/>
		<TaskData>
			<ApplicationData>
				<proc:forminputdata xmlns="http://schemas.cordys.com/1.0/xforms/processapi" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proc="http://schemas.cordys.com/1.0/xforms/processapi">
					<proc:freeformcontrols>
						<proc:input1 display_name="Input1"/>
					</proc:freeformcontrols>
				</proc:forminputdata>
			</ApplicationData>
			<CustomData/>
			<Annotation/>
		</TaskData>
		<LoggerContext>
			<Logger xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://schemas.cordys.com/General/1.0/">
				<DC name="process">bpmSample</DC>
				<DC name="instance">002481F0-8E9F-11E3-FC46-4707E0AABF8A</DC>
			</Logger>
		</LoggerContext>
		<DeliveryDate>2014-05-23T04:25:13.0</DeliveryDate>
		<StartDate>2014-05-23T04:25:13.0</StartDate>
		<DueDate isExpired="false"/>
		<StartedOn/>
		<CompletionDate/>
		<IsPriorityFixed>0</IsPriorityFixed>
		<Priority>3</Priority>
		<ParentQueue/>
		<UITaskId islegacy="false">002481F0-8E9F-11E3-FB7E-550D94D39713</UITaskId>
		<ActivityId>o_2</ActivityId>
		<Component>BPM</Component>
		<CallBackInfo>
			<ModelName xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">bpmSample</ModelName>
			<InstanceId xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">002481F0-8E9F-11E3-FC46-4707E0AABF8A</InstanceId>
			<ActivityId xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" iterationCount="1">o_2</ActivityId>
			<ActivityName xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">ui</ActivityName>
			<ParentSourceInstanceId xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" type="BPM">0</ParentSourceInstanceId>
			<RootInstanceId xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" type="PROCESS">002481F0-8E9F-11E3-FC46-4707E0AABF8A</RootInstanceId>
		</CallBackInfo>
		<Targets>
			<Target type="worklist">002481F0-8E9F-11E3-FB84-31AE2052D713</Target>
		</Targets>
		<url>ui.caf</url>
		<PossibleActions>
			<START/>
			<REVOKECLAIM/>
			<SUSPEND/>
			<SKIP/>
			<COMPLETE/>
			<DELEGATE/>
			<FORWARD/>
			<TRANSFER/>
			<EXECUTE/>
			<VIEW/>
		</PossibleActions>
	</Task>
	<State>ASSIGNED</State>
	<Assignee displayName="NewLaxman User" email="" phone1="" phone2="">cn=NewLaxman,cn=organizational users,o=system,cn=cordys,cn=defaultinst,o=opentext.net</Assignee>
</AssignTaskResponse>
	

 

 

Attachments: